<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>

        <f:facet name="last">
            <h:outputStylesheet library="default" name="/resources/omscss.css" />
        </f:facet>>

        <ui:composition template="/template/common/commonLayout.xhtml">                

            <ui:define name="content">

                <p:layoutUnit position="center">
                    
                    
                    <h:form id="campaignForm" enctype="multipart/form-data">

                        <div align="center">
                            
                            <p:panelGrid columns="1" styleClass="mainTitleBox">
                                <h:outputText value="Crear Productos" styleClass="mainTitle"/>
                            </p:panelGrid>

                            <p:panelGrid columns="3" columnClasses="nothing, nothing, noBorderColumn" styleClass="showTable">                            

                                <h:outputText value="Nombre Producto"/>
                                <p:inputText value="#{ProductBean.productDTO.name}" 
                                             style="width: 327px" 
                                             id="inputName" 
                                             maxlength="50"
                                             required="true"/>
                                <p:message for="inputName" showDetail="false" showSummary="true"/>

                                <h:outputText value="Descripción Producto"/>
                                <p:inputText value="#{ProductBean.productDTO.description}" 
                                             style="width: 327px" 
                                             required="true" 
                                             maxlength="80" 
                                             id="inputDescription"/>                    
                                <p:message for="inputDescription" showDetail="false" showSummary="true"/>

                                
                                <h:outputText value="Ciudad"/>
                                <p:inputText value="#{ProductBean.productDTO.cityId}" 
                                             style="width: 327px" 
                                             required="true" 
                                             maxlength="80" 
                                             id="inputCity"/>
                                <p:message for="inputCity" showDetail="false" showSummary="true"/>

                                                                
                                <h:outputText value="Tarifa Hotel"/>
                                <p:inputText value="#{ProductBean.productDTO.feeHotel}" 
                                             style="width: 327px" 
                                             required="true" 
                                             maxlength="80" 
                                             id="inputFeeHotel"/>                    
                                <p:message for="inputFeeHotel" showDetail="false" showSummary="true"/>
                                
                                
                                <h:outputText value="Tarifa Show"/>
                                <p:inputText value="#{ProductBean.productDTO.feeShow}" 
                                             style="width: 327px" 
                                             required="true" 
                                             maxlength="80" 
                                             id="inputFeeShow"/>                    
                                <p:message for="inputFeeShow" showDetail="false" showSummary="true"/>
                                
                                <h:outputText value="Tarifa Transporte"/>
                                <p:inputText value="#{ProductBean.productDTO.feeTtransport}" 
                                             style="width: 327px" 
                                             required="true" 
                                             maxlength="80" 
                                             id="inputFeeTransport"/>                    
                                <p:message for="inputFeeTransport" showDetail="false" showSummary="true"/>

                                
                                <h:outputText value="Cargar Archivo imagen producto"/>
                                <p:fileUpload value="#{ProductBean.file}"
                                              mode="simple"
                                              disabled="false"
                                              auto="true"
                                              required="true"
                                              id="inputFile"/>
                                <p:message for="inputFile" showDetail="false" showSummary="true"/>
                                
                            </p:panelGrid>

                            <p:growl id="growl" life="5000"/>

                            <p:panelGrid columns="2" styleClass="saveButtons"> 
                                
                                <p:commandButton value="Guardar" 
                                                 id="ajax" 
                                                 ajax="false"
                                                 update="growl"
                                                 actionListener="#{ProductBean.saveButton}"/>
                                <p:commandButton value="Cancelar"
                                                 immediate="true"
                                                 action="#{ProductBean.cancelButton}"/>

                            </p:panelGrid>

                        </div>
                    </h:form>
                    
                </p:layoutUnit>

            </ui:define>

        </ui:composition>

    </h:body>
</html>